#include <iostream>
//#include <windows.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    long long methods[51] = {0};
    int N, i;
    methods[1] = 3;
    methods[2] = 6;
    methods[3] = 6;
    for (i = 4; i <= 50; i++)
    {
        methods[i] = methods[i - 1] + 2 * methods[i - 2];
    }
    while (cin >> N)
    {
        cout << methods[N]  << endl;
    }
    //system("pause");
    return 0;
}